-
Notifications
You must be signed in to change notification settings - Fork 45
Add daemon.json with overlay2 to fix container startup issue #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.0-dev
Are you sure you want to change the base?
Add daemon.json with overlay2 to fix container startup issue #351
Conversation
6b58436 to
5110a47
Compare
ee1ab22 to
34d3f78
Compare
4a3f4e2 to
686f4fa
Compare
a2838e3 to
f720386
Compare
f720386 to
e876a84
Compare
c4934ed to
46d9f21
Compare
SPECS/moby-engine/moby-engine.spec
Outdated
| mkdir -p %{buildroot}/opt/docker-data | ||
| chmod 0700 %{buildroot}/opt/docker-data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant to line 118-119, where similar mkdir -p /opt/docker-data and chmod 0700 also added there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comment. I have removed the redundant mkdir -p /opt/docker-data and chmod 0700 /opt/docker-data from the %install section, keeping only the creation and permission commands in the %post script.
This is because:
-
The %install section runs during package build time, preparing the package filesystem (buildroot).
-
The %post section runs during package installation on the live system, which is the correct place to ensure /opt/docker-data exists with proper permissions on the target device.
|
Before switching |
9022047 to
5319537
Compare
We did try adding /var/lib/docker to PERSISTENT_BIND_PATHS before changing the data-root to /opt/docker-data. But because on EMT OS /var is often temporary (tmpfs) early in boot, Docker’s data under /var/lib/docker wasn’t actually persistent, so the overlayfs errors continued. Changing Docker’s data-root to /opt/docker-data and ensuring it is persistent and created at runtime fixed the problem. |
Added a daemon.json file to set "overlay2" as the storage driver and moved Docker’s data directory to /opt/docker-data. This change makes sure Docker starts properly on EMT OS. Also updated the spec file to install this config and copy any existing Docker data to the new location. Signed-off-by: Polmoorx Shiva Kumar <[email protected]>
5319537 to
00d09b3
Compare
Merge Checklist
All boxes should be checked before merging the PR
Description
On EMT OS, when we tried to start Docker, it failed because the default overlay2 storage driver requires a writable, overlay-compatible filesystem, but /var/lib/docker resides under /var, which on EMT OS can be mounted as read-only or which isn’t compatible with overlay operations. This prevented Docker from launching. To fix this, we configured Docker to store its data in /opt/docker-data, a persistent and writable location that supports overlay2, by adding a daemon.json file and updating the RPM spec to create the required directories, install the configuration, and safely migrate any existing data from /var/lib/docker using rsync. With this change, Docker now starts and runs reliably on both RT and non-RT EMT OS, using a stable and compatible storage location.
Any Newly Introduced Dependencies
No
How Has This Been Tested?
Tested manually.